# !ResEd shell Makefile

# ****** EDIT MAKEPROTO, NOT MAKEFILE ******
# Then construct Makefile using "amu -f MakeProto depend"

# PROGDIR should be set to the application's install directory

# Can set:
#  CFLAGS     -  additional cc options
#  INCLUDES   -  locations to search for "included" files
#  AFLAGS     -  additional objasm options
#  LDFLAGS    -  additional link options

INCLUDES = -I^.common

CPFLAGS = A~C~DF~L~N~P~Q~R~S~T~V

LIBS = ^.common.o.commonlib C:o.Stubs

CFILES = main.c document.c dragdrop.c protocol.c class.c fileinfo.c objflags.c rename.c copy.c genmsgs.c help.c

OFILES = main.o document.o dragdrop.o protocol.o class.o fileinfo.o objflags.o rename.o copy.o genmsgs.o help.o

FILES = ^.!Boot ^.!Help ^.!Run ^.!RunImage ^.!Sprites ^.!Sprites22 ^.Messages ^.Sprites ^.Sprites22 ^.Templates

all: ^.!RunImage
        @echo *** Shell build complete

^.!RunImage: $(OFILES) ^.common.o.commonlib
        cc -c $(CFLAGS) $(INCLUDES) -o ^.common.o.version ^.common.c.version
        link $(LDFLAGS) -o $@ $(OFILES) ^.common.o.version $(LIBS)
        squeeze $@

^.common.o.commonlib:
        dir ^.common
        amu o.commonlib
        dir ^.shell

h.icondefs: ^.Templates
        ^.^.!WinEdit -h ^.Templates > h.icondefs

.c.o:
        cc -c $(CFLAGS) $(INCLUDES) -o $@ $<

.s.o:
        objasm -quit -CloseExec $(AFLAGS) -from $< -to $@

install: $(FILES)
        copy ^.!Boot $(PROGDIR).!Boot $(CPFLAGS)
        copy ^.!Help $(PROGDIR).!Help $(CPFLAGS)
        copy ^.!Run $(PROGDIR).!Run $(CPFLAGS)
        copy ^.!RunImage $(PROGDIR).!RunImage $(CPFLAGS)
        copy ^.!Sprites $(PROGDIR).!Sprites $(CPFLAGS)
        copy ^.!Sprites22 $(PROGDIR).!Sprites22 $(CPFLAGS)
        copy ^.Messages $(PROGDIR).Messages $(CPFLAGS)
        copy ^.Sprites $(PROGDIR).Sprites $(CPFLAGS)
        copy ^.Sprites22 $(PROGDIR).Sprites22 $(CPFLAGS)
        copy ^.Templates $(PROGDIR).Templates $(CPFLAGS)
        @echo *** Shell installation complete

depend:
        copy MakeProto Makefile1 $(CPFLAGS)
        cc -c -M $(INCLUDES) $(CFILES) >> Makefile1
        remove Makefile0
        -rename Makefile Makefile0
        rename Makefile1 Makefile
        @echo *** Shell dependencies established

clean:
       create o.foo
       wipe o.* ~CRF~V
       remove ^.!RunImage
       remove h.icondefs
       @echo *** Shell cleaned

# Dependencies following this line provided by make depend

o.main:	c.main
o.main:	^.common.h.resed
o.main:	^.common.h.message
o.main:	^.common.h.error
o.main:	^.common.h.debug
o.main:	^.common.h.dbmalloc
o.main:	h.main
o.main:	^.common.h.swicall
o.main:	^.common.h.wimp
o.main:	^.common.h.resformat
o.main:	^.common.h.dbox
o.main:	^.common.h.dragdrop
o.main:	^.common.h.filetypes
o.main:	^.common.h.focus
o.main:	^.common.h.interactor
o.main:	^.common.h.menu
o.main:	^.common.h.registry
o.main:	^.common.h.saveas
o.main:	^.common.h.version
o.main:	h.class
o.main:	h.document
o.main:	h.copy
o.main:	h.fileinfo
o.main:	h.genmsgs
o.main:	h.help
o.main:	h.icondefs
o.main:	h.objflags
o.main:	h.protocol
o.main:	h.rename
o.document:	c.document
o.document:	^.common.h.resed
o.document:	^.common.h.message
o.document:	^.common.h.error
o.document:	^.common.h.debug
o.document:	^.common.h.dbmalloc
o.document:	h.main
o.document:	^.common.h.swicall
o.document:	^.common.h.wimp
o.document:	^.common.h.resformat
o.document:	^.common.h.newmsgs
o.document:	^.common.h.dbox
o.document:	^.common.h.dragdrop
o.document:	^.common.h.filetypes
o.document:	^.common.h.focus
o.document:	^.common.h.interactor
o.document:	^.common.h.menu
o.document:	^.common.h.registry
o.document:	^.common.h.saveas
o.document:	^.common.h.toolbox
o.document:	h.class
o.document:	h.document
o.document:	h.copy
o.document:	h.fileinfo
o.document:	h.genmsgs
o.document:	h.help
o.document:	h.icondefs
o.document:	h.objflags
o.document:	h.protocol
o.document:	h.rename
o.dragdrop:	c.dragdrop
o.dragdrop:	^.common.h.resed
o.dragdrop:	^.common.h.message
o.dragdrop:	^.common.h.error
o.dragdrop:	^.common.h.debug
o.dragdrop:	^.common.h.dbmalloc
o.dragdrop:	h.main
o.dragdrop:	^.common.h.wimp
o.dragdrop:	^.common.h.resformat
o.dragdrop:	^.common.h.dragdrop
o.dragdrop:	^.common.h.registry
o.dragdrop:	h.class
o.dragdrop:	h.document
o.protocol:	c.protocol
o.protocol:	^.common.h.resed
o.protocol:	^.common.h.message
o.protocol:	^.common.h.error
o.protocol:	^.common.h.debug
o.protocol:	^.common.h.dbmalloc
o.protocol:	h.main
o.protocol:	^.common.h.swicall
o.protocol:	^.common.h.wimp
o.protocol:	^.common.h.resformat
o.protocol:	^.common.h.newmsgs
o.protocol:	^.common.h.registry
o.protocol:	^.common.h.toolbox
o.protocol:	h.class
o.protocol:	h.document
o.protocol:	h.protocol
o.class:	c.class
o.class:	^.common.h.resed
o.class:	^.common.h.message
o.class:	^.common.h.error
o.class:	^.common.h.debug
o.class:	^.common.h.dbmalloc
o.class:	h.main
o.class:	^.common.h.swicall
o.class:	^.common.h.wimp
o.class:	^.common.h.resformat
o.class:	h.class
o.class:	h.document
o.fileinfo:	c.fileinfo
o.fileinfo:	^.common.h.resed
o.fileinfo:	^.common.h.message
o.fileinfo:	^.common.h.error
o.fileinfo:	^.common.h.debug
o.fileinfo:	^.common.h.dbmalloc
o.fileinfo:	h.main
o.fileinfo:	^.common.h.swicall
o.fileinfo:	^.common.h.wimp
o.fileinfo:	^.common.h.resformat
o.fileinfo:	^.common.h.dbox
o.fileinfo:	^.common.h.registry
o.fileinfo:	h.class
o.fileinfo:	h.document
o.fileinfo:	h.icondefs
o.fileinfo:	h.fileinfo
o.objflags:	c.objflags
o.objflags:	^.common.h.resed
o.objflags:	^.common.h.message
o.objflags:	^.common.h.error
o.objflags:	^.common.h.debug
o.objflags:	^.common.h.dbmalloc
o.objflags:	h.main
o.objflags:	^.common.h.swicall
o.objflags:	^.common.h.wimp
o.objflags:	^.common.h.resformat
o.objflags:	^.common.h.dbox
o.objflags:	^.common.h.interactor
o.objflags:	^.common.h.registry
o.objflags:	h.class
o.objflags:	h.document
o.objflags:	h.icondefs
o.objflags:	h.objflags
o.rename:	c.rename
o.rename:	^.common.h.resed
o.rename:	^.common.h.message
o.rename:	^.common.h.error
o.rename:	^.common.h.debug
o.rename:	^.common.h.dbmalloc
o.rename:	h.main
o.rename:	^.common.h.swicall
o.rename:	^.common.h.wimp
o.rename:	^.common.h.resformat
o.rename:	^.common.h.dbox
o.rename:	^.common.h.interactor
o.rename:	^.common.h.registry
o.rename:	h.class
o.rename:	h.document
o.rename:	h.icondefs
o.rename:	h.rename
o.copy:	c.copy
o.copy:	^.common.h.resed
o.copy:	^.common.h.message
o.copy:	^.common.h.error
o.copy:	^.common.h.debug
o.copy:	^.common.h.dbmalloc
o.copy:	h.main
o.copy:	^.common.h.swicall
o.copy:	^.common.h.wimp
o.copy:	^.common.h.resformat
o.copy:	^.common.h.dbox
o.copy:	^.common.h.interactor
o.copy:	^.common.h.registry
o.copy:	h.class
o.copy:	h.document
o.copy:	h.copy
o.copy:	h.icondefs
o.genmsgs:	c.genmsgs
o.genmsgs:	^.common.h.resed
o.genmsgs:	^.common.h.message
o.genmsgs:	^.common.h.error
o.genmsgs:	^.common.h.debug
o.genmsgs:	^.common.h.dbmalloc
o.genmsgs:	h.main
o.genmsgs:	^.common.h.wimp
o.genmsgs:	^.common.h.resformat
o.genmsgs:	^.common.h.saveas
o.genmsgs:	h.class
o.genmsgs:	h.document
o.genmsgs:	h.genmsgs
o.genmsgs:	h.protocol
o.help:	c.help
o.help:	^.common.h.resed
o.help:	^.common.h.message
o.help:	^.common.h.error
o.help:	^.common.h.debug
o.help:	^.common.h.dbmalloc
o.help:	h.main
o.help:	^.common.h.swicall
o.help:	^.common.h.wimp
o.help:	^.common.h.resformat
o.help:	^.common.h.newmsgs
o.help:	^.common.h.menu
o.help:	^.common.h.registry
o.help:	h.document
o.help:	h.help
